var Component = function()
{
	this.name="";
	this.color="";
	this.x=0;
	this.y=0;
	this.width=0;
	this.height=0;
	this.items = new Array();
	//active item to display
	this.activeItem = function(item)
	{
		for(var i=0;i<this.items.length;i++)
 	    {
     	   this.items[i].active=false;
 	    }
		item.active=true;
		
		
	};
	this.deActiveItem = function(item)
	{
//		for(var i=0;i<this.items.length;i++)
// 	    {
//     	   this.items[i].active=false;
// 	    }
		item.active=false;
		
		
	};
	this.getActiveItem=function()
	{
		for(var i=0;i<this.items.length;i++)
 	    {
     	   if(this.items[i].active)
     		   {
     		   	return this.items[i];
     		   }
 	    }
	}
	
	this.draw = function(graphic)
	{
		//alert("aaa"+this.items.length);
		for(var i=0;i<this.items.length;i++)
 	    {
     	   this.items[i].draw(graphic);
     	  
 	    }
	};
};